package top.kiterunner.learning.concurrency_test;

import java.util.concurrent.TimeUnit;

/**
 * AdorynZhao in Tencent-UESTC.
 * Source Code Created on 2017/7/3.
 * 问题：子类调用父类的同步方法
 */
public class ThreadDemo5_Base {

    public synchronized void method() {
        System.out.println("Base Method Start...");

        try {
            TimeUnit.SECONDS.sleep(1);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        System.out.println("Base Method Ending...");
    }

    public static void main(String[] args) {
        ThreadDemo5_Base base = new ThreadDemo5_Derived();
        base.method();
    }
}
